@import "./action-sheet.vars";

// Action Sheet
// --------------------------------------------------

:host {
  /**
   * @prop --background: Background of the action sheet group
   * @prop --background-activated: Background of the activated action sheet button
   * @prop --background-selected: Background of the selected action sheet button
   * @prop --color: Color of the action sheet text
   *
   * @prop --min-width: Minimum width of the action sheet
   * @prop --width: Width of the action sheet
   * @prop --max-width: Maximum width of the action sheet
   *
   * @prop --min-height: Minimum height of the action sheet
   * @prop --height: height of the action sheet
   * @prop --max-height: Maximum height of the action sheet
   */
  --color: initial;
  --min-width: auto;
  --width: #{$action-sheet-width};
  --max-width: #{$action-sheet-max-width};
  --min-height: auto;
  --height: 100%;
  --max-height: 100%;

  @include font-smoothing();
  @include position(0, 0, 0, 0);

  display: block;
  position: fixed;

  font-family: $font-family-base;

  touch-action: none;
  user-select: none;
  z-index: $z-index-overlay;
}

:host(.overlay-hidden) {
  display: none;
}

.action-sheet-wrapper {
  @include position(null, 0, 0, 0);
  @include margin(auto);
  @include transform(translate3d(0, 100%, 0));

  display: block;
  position: absolute;

  width: var(--width);
  min-width: var(--min-width);
  max-width: var(--max-width);

  height: var(--height);
  min-height: var(--min-height);
  max-height: var(--max-height);

  z-index: $z-index-overlay-wrapper;
  pointer-events: none;
}

.action-sheet-button {
  width: 100%;

  border: 0;

  outline: none;

  font-family: inherit;
}

.action-sheet-button.activated {
  background: var(--background-activated);
}

.action-sheet-button-inner {
  display: flex;

  flex-flow: row nowrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;
}

.action-sheet-container {
  display: flex;

  flex-flow: column;
  justify-content: flex-end;

  height: 100%;
  max-height: 100%;
}

.action-sheet-group {
  flex-shrink: 2;
  overscroll-behavior-y: contain;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  pointer-events: all;

  background: var(--background);
}

.action-sheet-group::-webkit-scrollbar {
  display: none;
}

.action-sheet-group-cancel {
  flex-shrink: 0;

  overflow: hidden;
}

.action-sheet-selected {
  background: var(--background-selected);
}